//
//  NetWorkManager.h
//  game
//
//  Created by 马凌云 on 2018/3/7.
//  Copyright © 2018年 YD. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "NetWorkExtend.h"

@interface NetWorkManager : NSObject

/**
 *  get请求
 *
 *  @param url          url
 *  @param completion   block回调，包含responseObject和error
 *
 */
+ (void)getRequestForUrl:(NSString *)url completion:(void (^)(id responseObject, NSError *error))completion;


+ (void)postRequestForUrl:(NSString *)url params:(NSDictionary *)params extend:(NetWorkExtend *)extend completion:(void (^)(id responseObject, NSError *error))completion;

/**
 *  post请求
 *
 *  @param url          url
 *  @param params       参数
 *  @param extend       extend,扩展数据
 *  @param cache        cache回调，包含responseObject
 *  @param completion   block回调，包含responseObject和error
 *
 */
+ (void)postRequestForUrl:(NSString *)url params:(NSDictionary *)params extend:(NetWorkExtend *)extend cache:(void (^) (id responseObject))cache completion:(void (^)(id responseObject, NSError *error))completion;

@end
